package cn.fan.testfunction.devise.proxy;

/**
 * 糖装饰器，用来给咖啡加糖
 */
public class SugarDecorator extends AbstrcatDecorator {

    /**
     * 持有的咖啡对象
     */
    private final Coffee coffee;

    public SugarDecorator(Coffee coffee) {
        this.coffee = coffee;
    }

    @Override
    public void printMaterial() {

        System.out.println("糖");
        this.coffee.printMaterial();
    }
}